function Vector(x, y) {
    this.x = x;
    this.y = y;

    this.mulS = function(value) {
        return new Vector(this.x * value, this.y * value);
    };

    this.multiply = function(vector) {
        return new Vector(this.x * vector.x, this.y * vector.y);
    };

    this.divS = function(value) {
        return new Vector(this.x / value, this.y / value);
    };

    this.addS = function(value) {
        return new Vector(this.x + value, this.y + value);
    };

    this.add = function(vector) {
        return new Vector(this.x + vector.x, this.y + vector.y);
    };

    this.subS = function(value) {
        return new Vector(this.x - value, this.y - value);
    };

    this.sub = function(vector) {
        return new Vector(this.x - vector.x, this.y - vector.y);
    };

    this.abs = function() {
        return new Vector(Math.abs(this.x), Math.abs(this.y));
    };

    this.round = function() {
        return new Vector(Math.round(this.x), Math.round(this.y));
    };

    this.dotProduct = function(vector) {
        return (this.x * vector.x + this.y * vector.y);
    };

    this.length = function() {
        return Math.sqrt(this.dotProduct(this));
    };

    this.dist = function(vector) {
        return (vector.sub(this)).length();
    };

    this.lengthSqr = function() {
        return this.dot(this);
    }
    /*
     vector linear interpolation
     interpolate between two vectors.
     value should be in 0.0f - 1.0f space
     */
    this.lerp = function(vector, value) {
        return new Vector(
                this.x + (vector.x - this.x) * value,
                this.y + (vector.y - this.y) * value
                );
    };

    this.norm = function() {
        return this.divS(this.length());
    };

    this.norm2 = function() {
        return Math.sqrt(this.x * this.x + this.y * this.y);
    };


    this.normSquared = function() {
        return this.x * this.x + this.y * this.y;
    };
}